{extend name="admin@public/layout/popup_form"}

{block name="form"}
    <div class="layui-form-item">
        <label class="layui-form-label" title="用户名">用户名 <text title="必填项" style="color:red;">*</text></label>
        <div class="layui-input-block">
            <input type="text" name="row[username]" placeholder="请输入用户名" value="{$username}" class="layui-input" lay-verify="required" lay-verType="tips">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label" title="姓名">昵称 <text title="必填项" style="color:red;">*</text></label>
        <div class="layui-input-block">
            <input type="text" name="row[nickname]" placeholder="请输入昵称" value="{$nickname}" class="layui-input" lay-verify="required" lay-verType="tips">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label" title="密码">密码 <text title="必填项" style="color:red;">*</text></label>
        <div class="layui-input-block">
            <input type="password" name="row[password]" placeholder="请输入密码，留空表示不编辑密码" class="layui-input" lay-verType="tips">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label" title="密码">重复密码 <text title="必填项" style="color:red;">*</text></label>
        <div class="layui-input-block">
            <input type="password" name="row[re_password]" placeholder="请输入密码，留空表示不编辑密码" class="layui-input" lay-verType="tips">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label" title="是否为超管">账号状态</label>
        <div class="layui-input-block">
            <!-- 隐藏域设置开关未选中时需要传递的参数值 -->
            <input type="hidden" name="row[status]" value="0" />
            <input type="checkbox" name="row[status]" lay-skin="switch" lay-text="正常|冻结" value="1" {if 1 == $status}checked="checked"{/if} />
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label" title="是否为超管">是否为超管</label>
        <div class="layui-input-block">
            <!-- 隐藏域设置开关未选中时需要传递的参数值 -->
            <input type="hidden" name="row[is_super_manager]" value="0" />
            <input type="checkbox" name="row[is_super_manager]" lay-skin="switch" lay-text="是|否" value="1" {if 1 == $is_super_manager}checked="checked"{/if} />
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label" title="单个图片">头像</label>
        <div class="layui-input-block">
            <div class="layui-upload">
                <div class="layui-inline" style="width: 75%;"><input type="text" class="layui-input" name="row[avatar]" id="input_avatar" value="{$avatar}" /></div>
                <div class="layui-inline">
                    <button type="button" class="layui-btn layui-btn-primary pull-left"
                            id="avatar"
                            upload="true"
                            accept="images"
                            single_multi="single"
                    >选择上传</button>
                </div>
                <div class="pic-more">
                    <ul class="pic-more-upload-list" id="preview_avatar">
                        {if $avatar}
                        <li class="item_img">
                            <div class="operate">
                                <i class="upload_img_close layui-icon" file_url_data="{$avatar}"></i>
                            </div>
                            <img src="{$avatar}" class="img">
                        </li>
                        {/if}
                    </ul>
                </div>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label" title="">角色</label>
        <div class="layui-input-block">
            <input autocomplete="off" type="text" name="row[role_ids]" id="role_ids" value="{$role_ids}" placeholder="请选择" class="layui-input selectPage"
                   search-field="name"
                   search-url="{:url('admin/auth.role/select_page')}"
                   show-field="name"
                   search-condition="LIKE"
                   show-multiple="true"
            >
        </div>
    </div>
{/block}